package constant

const (
	// 正常响应
	RESPONSE_CODE_OK = 10000
	// 常规错误
	RESPONSE_CODE_ERROR = 90000
	// 系统故障
	RESPONSE_CODE_CRASH = 90500
	// 登录会话无效或已掉线
	RESPONSE_CODE_SESSION_INVALID = 90600
	// 登录会话被踢
	RESPONSE_CODE_SESSION_KICK = 90601
	// AppKey无效
	RESPONSE_CODE_APPKEY_INVALID = 90700
	// AccessToken无效
	RESPONSE_CODE_ACCESSTOKEN_INVALID = 90701
	// Sign无效
	RESPONSE_CODE_SIGN_INVALID = 90702
	// TimeStamp无效
	RESPONSE_CODE_TIMESTAMP_INVALID = 90703
	// Action无效
	RESPONSE_CODE_ACTION_INVALID = 90704
	// 帐号不从属于某一企业
	RESPONSE_CODE_CORP_ACCOUNT_INVALID = 90800
	// 超出允许企业在线用户数量
	RESPONSE_CODE_CORP_SESSION_OVERFLOW = 90801
	// 非企业超级管理员
	RESPONSE_CODE_CORP_ADMIN_INVALID = 90802
)

func GetResponseMsg(code int) string {
	msg := ""

	switch code {
	case RESPONSE_CODE_SESSION_INVALID:
		msg = "用户没有登录"
	case RESPONSE_CODE_SESSION_KICK:
		msg = "用户被踢"
	case RESPONSE_CODE_APPKEY_INVALID:
		msg = "AppKey无效"
	case RESPONSE_CODE_ACCESSTOKEN_INVALID:
		msg = "AccessToken无效"
	case RESPONSE_CODE_TIMESTAMP_INVALID:
		msg = "TimeStamp无效"
	case RESPONSE_CODE_SIGN_INVALID:
		msg = "Sign无效"
	case RESPONSE_CODE_ACTION_INVALID:
		msg = "Action无效"
	case RESPONSE_CODE_CORP_ACCOUNT_INVALID:
		msg = "用户不是该企业成员"
	case RESPONSE_CODE_CORP_SESSION_OVERFLOW:
		msg = "企业在线人数已满，请稍候再试"
	case RESPONSE_CODE_CORP_ADMIN_INVALID:
		msg = "用户不是该企业超级管理员"
		/****** msg 由接口自定义输出 *****/
		// case RESPONSE_CODE_PARAM_INVALID:
		// 	msg = "参数缺失或无效"
		// case RESPONSE_CODE_LOGIC_INVALID:
		// 	msg = "处理条件不满足"
		//	case RESPONSE_CODE_DATA_EMPTY:
		//		msg = "查找不到数据"
	}

	//	if len(msg) > 0 {
	//		log.Logger.Info("接口级错误：", r.msg)
	//		r.msg = msg
	//	}

	return msg
}
